3.35 \(\int \frac {1}{1+\cosh ^2(x)} \, dx\)

Optimal. Leaf size=15 \[ \frac {\tanh ^{-1}\left (\frac {\tanh (x)}{\sqrt {2}}\right )}{\sqrt {2}} \]

[Out]

1/2*arctanh(1/2*2^(1/2)*tanh(x))*2^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3181, 206} \[ \frac {\tanh ^{-1}\left (\frac {\tanh (x)}{\sqrt {2}}\right )}{\sqrt {2}} \]

Antiderivative was successfully verified.

[In]

Int[(1 + Cosh[x]^2)^(-1),x]

[Out]

ArcTanh[Tanh[x]/Sqrt[2]]/Sqrt[2]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3181

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(-1), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist
[ff/f, Subst[Int[1/(a + (a + b)*ff^2*x^2), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x]

Rubi steps

\begin {align*} \int \frac {1}{1+\cosh ^2(x)} \, dx &=\operatorname {Subst}\left (\int \frac {1}{1-2 x^2} \, dx,x,\coth (x)\right )\\ &=\frac {\tanh ^{-1}\left (\frac {\tanh (x)}{\sqrt {2}}\right )}{\sqrt {2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [F]  time = 0.02, size = 0, normalized size = 0.00 \[ \int \frac {1}{1+\cosh ^2(x)} \, dx \]

Verification is Not applicable to the result.

[In]

Integrate[(1 + Cosh[x]^2)^(-1),x]

[Out]

Integrate[(1 + Cosh[x]^2)^(-1), x]

________________________________________________________________________________________

fricas [B]  time = 0.40, size = 66, normalized size = 4.40 \[ \frac {1}{4} \, \sqrt {2} \log \left (-\frac {3 \, {\left (2 \, \sqrt {2} - 3\right )} \cosh \relax (x)^{2} - 4 \, {\left (3 \, \sqrt {2} - 4\right )} \cosh \relax (x) \sinh \relax (x) + 3 \, {\left (2 \, \sqrt {2} - 3\right )} \sinh \relax (x)^{2} + 2 \, \sqrt {2} - 3}{\cosh \relax (x)^{2} + \sinh \relax (x)^{2} + 3}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+cosh(x)^2),x, algorithm="fricas")

[Out]

1/4*sqrt(2)*log(-(3*(2*sqrt(2) - 3)*cosh(x)^2 - 4*(3*sqrt(2) - 4)*cosh(x)*sinh(x) + 3*(2*sqrt(2) - 3)*sinh(x)^
2 + 2*sqrt(2) - 3)/(cosh(x)^2 + sinh(x)^2 + 3))

________________________________________________________________________________________

giac [B]  time = 0.14, size = 34, normalized size = 2.27 \[ \frac {1}{4} \, \sqrt {2} \log \left (-\frac {2 \, \sqrt {2} - e^{\left (2 \, x\right )} - 3}{2 \, \sqrt {2} + e^{\left (2 \, x\right )} + 3}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+cosh(x)^2),x, algorithm="giac")

[Out]

1/4*sqrt(2)*log(-(2*sqrt(2) - e^(2*x) - 3)/(2*sqrt(2) + e^(2*x) + 3))

________________________________________________________________________________________

maple [B]  time = 0.05, size = 86, normalized size = 5.73 \[ \frac {\sqrt {2}\, \ln \left (\frac {\tanh ^{2}\left (\frac {x}{2}\right )+\sqrt {2}\, \tanh \left (\frac {x}{2}\right )+1}{\tanh ^{2}\left (\frac {x}{2}\right )-\sqrt {2}\, \tanh \left (\frac {x}{2}\right )+1}\right )}{8}-\frac {\sqrt {2}\, \ln \left (\frac {\tanh ^{2}\left (\frac {x}{2}\right )-\sqrt {2}\, \tanh \left (\frac {x}{2}\right )+1}{\tanh ^{2}\left (\frac {x}{2}\right )+\sqrt {2}\, \tanh \left (\frac {x}{2}\right )+1}\right )}{8} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(1+cosh(x)^2),x)

[Out]

1/8*2^(1/2)*ln((tanh(1/2*x)^2+2^(1/2)*tanh(1/2*x)+1)/(tanh(1/2*x)^2-2^(1/2)*tanh(1/2*x)+1))-1/8*2^(1/2)*ln((ta
nh(1/2*x)^2-2^(1/2)*tanh(1/2*x)+1)/(tanh(1/2*x)^2+2^(1/2)*tanh(1/2*x)+1))

________________________________________________________________________________________

maxima [B]  time = 0.59, size = 34, normalized size = 2.27 \[ -\frac {1}{4} \, \sqrt {2} \log \left (-\frac {2 \, \sqrt {2} - e^{\left (-2 \, x\right )} - 3}{2 \, \sqrt {2} + e^{\left (-2 \, x\right )} + 3}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+cosh(x)^2),x, algorithm="maxima")

[Out]

-1/4*sqrt(2)*log(-(2*sqrt(2) - e^(-2*x) - 3)/(2*sqrt(2) + e^(-2*x) + 3))

________________________________________________________________________________________

mupad [B]  time = 0.14, size = 50, normalized size = 3.33 \[ \frac {\sqrt {2}\,\left (\ln \left (-4\,{\mathrm {e}}^{2\,x}-\frac {\sqrt {2}\,\left (12\,{\mathrm {e}}^{2\,x}+4\right )}{4}\right )-\ln \left (\frac {\sqrt {2}\,\left (12\,{\mathrm {e}}^{2\,x}+4\right )}{4}-4\,{\mathrm {e}}^{2\,x}\right )\right )}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cosh(x)^2 + 1),x)

[Out]

(2^(1/2)*(log(- 4*exp(2*x) - (2^(1/2)*(12*exp(2*x) + 4))/4) - log((2^(1/2)*(12*exp(2*x) + 4))/4 - 4*exp(2*x)))
)/4

________________________________________________________________________________________

sympy [B]  time = 0.68, size = 60, normalized size = 4.00 \[ - \frac {\sqrt {2} \log {\left (4 \tanh ^{2}{\left (\frac {x}{2} \right )} - 4 \sqrt {2} \tanh {\left (\frac {x}{2} \right )} + 4 \right )}}{4} + \frac {\sqrt {2} \log {\left (4 \tanh ^{2}{\left (\frac {x}{2} \right )} + 4 \sqrt {2} \tanh {\left (\frac {x}{2} \right )} + 4 \right )}}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+cosh(x)**2),x)

[Out]

-sqrt(2)*log(4*tanh(x/2)**2 - 4*sqrt(2)*tanh(x/2) + 4)/4 + sqrt(2)*log(4*tanh(x/2)**2 + 4*sqrt(2)*tanh(x/2) +
4)/4

________________________________________________________________________________________